import uvicorn

def get_pc_ip():
    import socket
    return socket.gethostbyname(socket.gethostname())

def main():
    from .trans import app
    # 手动导入 禁止pycharm的警告
    # 方便在Windows下调试
    # uvicorn app.trans:app --host 0.0.0.0 --port 4141 --workers 4
    print(f"Server running on http://{get_pc_ip()}:4141/doc")
    uvicorn.run("trans:app", host='0.0.0.0', port=4141, workers=4)

if __name__ == '__main__':
    main()